package com.example.demo.enums;

import com.zhucan.enums.core.enums.CodeEnum;
import com.zhucan.enums.conversion.annotation.EnumAutoConverter;
import com.zhucan.enums.scanner.annotation.EnumScan;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 订单优先级枚举
 */
@Getter
@AllArgsConstructor
@EnumScan(
    description = "订单优先级",
    defaultEnumCode = 2,
    category = "Order"
)
@EnumAutoConverter
public enum OrderPriorityEnum implements CodeEnum {
    
    /**
     * 低优先级
     */
    LOW(1, "低优先级"),
    
    /**
     * 普通优先级
     */
    NORMAL(2, "普通优先级"),
    
    /**
     * 高优先级
     */
    HIGH(3, "高优先级"),
    
    /**
     * 紧急优先级
     */
    URGENT(4, "紧急优先级");

    private final Integer code;
    private final String name;

    @Override
    public Integer code() {
        return this.code;
    }

    @Override
    public String value() {
        return this.name;
    }
    
    /**
     * 获取优先级权重（用于排序）
     */
    public int getWeight() {
        return this.code;
    }
}
